function deepClone (obj) {
    if (typeof obj !== 'object' || obj == null) {
        return obj
    }

    const result = (obj instanceof Array) ? [] : {}

    for (let key in obj) {
        if (obj.hasOwnProperty(key)) {
            result[key] = deepClone(obj[key])
        }
    }
    return result
}

const obj = {
    name: 'lisi',
    arr: [1, 2, 3],
    info: {
        address: 'beijing'
    }
}

const objClone = deepClone(obj)
objClone.name = 'zhangsan'
console.log(obj, objClone)